package com.kingwang.training.ooad.coffeemaker.badway;

import com.kingwang.training.ooad.coffeemaker.hardware.api.CoffeeMakerApi;
import com.kingwang.training.ooad.coffeemaker.hardware.api.WarmerPlateStatus;
import org.springframework.stereotype.Component;

/**
 * 保温盘传感器
 *
 * @author King
 */
@Component
public class PlateSensor extends Sensor {
    public PlateSensor(CoffeeMakerApi coffeeMakerApi) {
        super(coffeeMakerApi);
    }

    @Override
    public int sense() {
        WarmerPlateStatus status = this.coffeeMakerApi.getWarmerPlateStatus();
        return status.ordinal();
    }
}
